<template>
	<div class="body" v-cloak>
    <div class="header">
		<!-- 第一导航栏 -->
		<div class="logo-one">
		        <div class="logo-one-title01"><span>酒店编号:  000381&nbsp;&nbsp;&nbsp;&nbsp;捷云体验酒店</span></div>
		        <div class="logo-one-title02"><span>营业日:</span></div>
		        <div class="logo-one-title11" style="[v-cloak]{display: none}" ><span id="dateTime"></span></div>
		        <div class="logo-one-title03"><span>早班</span></div>
		        <div class="logo-one-title04"><a href=""><span style="color: #0000FF">&nbsp;&nbsp;关闭班次&nbsp;&nbsp;</span></a></div>
		        <div class="logo-one-title05"><a href=""><span style="color: #0000FF">&nbsp;&nbsp;切换班次&nbsp;&nbsp;</span></a></div>
		        <div class="logo-one-title06"><a href="https://myplugin.speedtest.cn/#/" target="_blank"><img src="../../assets/img/Internet.png" alt="" style="width: 40px;height: 20px"/></a></div>
		        <div class="logo-one-title07"><span>服务热线 :</span></div>
		        <div class="logo-one-title08"><span>400-9922-511</span></div>
		        <div class="logo-one-title09"><a href=""><span style="color: #0000FF">退出</span></a></div>
		        <div class="logo-one-title10"><span>用户名: 体验者</span></div>
		</div>
		
			   <!-- 第二标题栏 -->
			<div class="logo-second">
			    <div class="logo-second-img">
			        <img src="../../assets/img/logo.png" alt="" style="width: 155px;height: 55px;"/>
			    </div>
			    <div class="logo-title">
			        <span><i>捷信达GSHIS捷云酒店管理软件V2.0（标准版）</i></span>
			    </div>   
				 
		</div>
		<div class="logo-third">
        <!-- 折叠按钮 -->
        <div class="collapse-btn" @click="collapseChage">
            <i v-if="!collapse" class="el-icon-s-fold"></i>
            <i v-else class="el-icon-s-unfold"></i>
        </div>
        <div class="logo"></div>
        <div class="header-right">
            <div class="header-user-con">
                <!-- 全屏显示 -->
                <div class="btn-fullscreen" @click="handleFullScreen">
                    <el-tooltip effect="dark" :content="fullscreen?`取消全屏`:`全屏`" placement="bottom">
                        <i class="el-icon-rank"></i>
                    </el-tooltip>
                </div>
			</div>
                <!-- 消息中心 
                <div class="btn-bell">
                    <el-tooltip
                        effect="dark"
                        :content="message?`有${message}条未读消息`:`消息中心`"
                        placement="bottom"
                    >
                        <router-link to="/tabs">
                            <i class="el-icon-bell"></i>
                        </router-link>
                    </el-tooltip>
                    <span class="btn-bell-badge" v-if="message"></span>
                </div>
				-->
           <!--     //用户头像
                <div class="user-avator">
                    <img src="../../assets/img/img.jpg" />
                </div>
                 //用户名下拉菜单
                <el-dropdown class="user-name" trigger="click" @command="handleCommand">
                    <span class="el-dropdown-link">
                        {{username}}
                        <i class="el-icon-caret-bottom"></i>
                    </span>
                    <el-dropdown-menu slot="dropdown">
                        <a href="https://github.com/lin-xin/vue-manage-system" target="_blank">
                            <el-dropdown-item>项目仓库</el-dropdown-item>
                        </a>
                        <el-dropdown-item divided command="loginout">退出登录</el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown> -->
            </div>
        </div>
    </div>
	</div>
</template>
<script>
import bus from '../common/bus';
import $ from 'jquery';
export default {
    data() {
        return {
            collapse: false,
            fullscreen: false,
            name: 'linxin',
            message: 2
        };
    },
    computed: {
        username() {
            let username = localStorage.getItem('ms_username');
            return username ? username : this.name;
        }
    },
    methods: {
        // 用户名下拉菜单选择事件
        handleCommand(command) {
            if (command == 'loginout') {
                localStorage.removeItem('ms_username');
                this.$router.push('/login');
            }
        },
        // 侧边栏折叠
        collapseChage() {
            this.collapse = !this.collapse;
            bus.$emit('collapse', this.collapse);
        },
        // 全屏事件
        handleFullScreen() {
            let element = document.documentElement;
            if (this.fullscreen) {
                if (document.exitFullscreen) {
                    document.exitFullscreen();
                } else if (document.webkitCancelFullScreen) {
                    document.webkitCancelFullScreen();
                } else if (document.mozCancelFullScreen) {
                    document.mozCancelFullScreen();
                } else if (document.msExitFullscreen) {
                    document.msExitFullscreen();
                }
            } else {
                if (element.requestFullscreen) {
                    element.requestFullscreen();
                } else if (element.webkitRequestFullScreen) {
                    element.webkitRequestFullScreen();
                } else if (element.mozRequestFullScreen) {
                    element.mozRequestFullScreen();
                } else if (element.msRequestFullscreen) {
                    // IE11
                    element.msRequestFullscreen();
                }
            }
            this.fullscreen = !this.fullscreen;
        }
    },
    mounted() {
        if (document.body.clientWidth < 1500) {
            this.collapseChage();
        }
    }
};

   //导航时间事件
    Date.prototype.format = function (fmt) {
        var o = {
            "y+": this.getFullYear, //年
            "M+": this.getMonth() + 1, //月份
            "d+": this.getDate(), //日
            "h+": this.getHours(), //小时
            "m+": this.getMinutes(), //分
            "s+": this.getSeconds() //秒
        };
        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }
    setInterval("document.getElementById('dateTime').innerHTML = (new Date()).format('yyyy-MM-dd');",0);


</script>

<style scoped>
	.logo-one{
	    height: 32px;
	    background-color: #F5F5F5;
	    border: 0px solid rosybrown;
	}
	
	.logo-one-title01{
	    margin-top: 6px;
	    margin-left: 30px;
	    color: #555555;
	    font-size: 10px;
	    float: left;
	}
	.logo-one-title02{
	    margin-top: 6px;
	    margin-left: 20px;
	    color: #555555;
	    font-size: 10px;
	    float: left;
	}
	.logo-one-title03{
	    margin-top: 6px;
	    margin-left: 20px;
	    color: #555555;
	    font-size: 10px;
	    float: left;
	}
	
	.logo-one-title04{
	    margin-top: 6px;
	    border: 1px solid #0000FF;
	    border-radius: 6px;
	    margin-left: 20px;
	    font-size: 10px;
	    float: left;
	}
	.logo-one-title05{
	    margin-top: 6px;
	    border: 1px solid #0000FF;
	    border-radius: 6px;
	    font-size: 10px;
	    margin-left: 10px;
	    float: left;
	}
	
	.logo-one-title06{
	    margin-top: 5px;
	    margin-left: 12px;
	    float: left;
	}
	
	.logo-one-title07{
	    margin-top: 6px;
	    color: #555555;
	    font-size: 10px;
	    margin-left: 12px;
	    float: left;
	}
	
	.logo-one-title08{
	    margin-top: 7px;
	    font-size: 14px;
	    color: #004793;
	    font-weight: bold;
	    margin-left: 7px;
	    float: left;
	}
	
	.logo-one-title09{
	    margin-top: 6px;
	    margin-left: 40px;
	    margin-right: 10px;
	    color: #555555;
	    font-size: 10px;
	    float: right;
	}
	
	.logo-one-title10{
	    margin-top: 6px;
	    font-size: 10px;
		 color: #555555;
	    float: right;
	}
	
	.logo-one-title11 span{
	    border: 0px solid red;
	    height: 15px;
	    width: 62px;
	    margin-top: 7px;
	    margin-left: 8px;
	    color: #555555;
	    font-size: 10px;
	    float: left;
	}
	
	
	.logo-second{
	    height: 60px;
	    border: 0px solid black;
	}
	
	.logo-second-img{
	    border: 0px solid red;
	    width: 160px;
	    float: left;
	    margin-left:23px ;
	    display: inline-block;
		height: 55px;
	}
	
	.logo-title{
	    border: 0px solid red;
	    font-weight: bold;
	    font-size: 20px;
	    display: inline-block;
	    margin-top: 14px;
	    height: 30px;
		color:#000000;
	}
	
      .logo-third{
	    border: 0px solid red;
		box-sizing: border-box;
		width: 100%;
		height: 28px;
		font-size: 22px;
		color: #fff;
	}
	
	
	
.header {
    box-sizing: border-box;
    border: 0px solid red;    
    width: 100%;
    height: 120px;
    font-size: 22px;
    color: #fff;
}



.collapse-btn {
    float: left;
    padding: 0 21px;
   cursor: pointer;
    line-height: 30px;

}
.header .logo {
    float: left;
    width: 250px;
    line-height: 70px;
}
.header-right {
    float: right;
    padding-right:0px;
}
.header-user-con {
    display: flex;
    height: 30px;
    align-items: center;
}
.btn-fullscreen {
    transform: rotate(45deg);
    margin-right: 5px;
    font-size: 24px;
}
.btn-bell,
.btn-fullscreen {
    position: relative;
    width: 30px;
    height: 30px;
    text-align: center;
    border-radius: 15px;
    cursor: pointer;
}
.btn-bell-badge {
    position: absolute;
    right: 0;
    top: -2px;
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: #f56c6c;
    color: #fff;
}
.btn-bell .el-icon-bell {
    color: #fff;
}
.user-name {
    margin-left: 10px;
}
.user-avator {
    margin-left: 20px;
}
.user-avator img {
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.el-dropdown-link {
    color: #fff;
    cursor: pointer;
}
.el-dropdown-menu__item {
    text-align: center;
}

[v-cloak] {
 	 display: none !important;
        }

</style>
